package com.yqg.protection.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * sdf300_history_data 实体类
 *
 * @author zxf
 * @since 2025-08-08
 */
@Getter
@Setter
@TableName("sdf300_history_data")
@ApiModel(value = "Sdf300HistoryData对象", description = "SDF300设备历史数据表")
public class Sdf300HistoryData implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("设备ID")
    private Long equipmentInputStoreId;

    @ApiModelProperty("数据发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime sendTime;

    @ApiModelProperty("电能标志: 1-有电能, 0-无电能")
    private Integer hasPower;

    @ApiModelProperty("谐波标志: 1-有谐波, 0-无谐波")
    private Integer hasHarmonic;

    @ApiModelProperty("相数标志: 1-三相, 0-单相")
    private Integer phaseType;

    @ApiModelProperty("DI通道: 1-4DI, 0-2DI")
    private Integer diChannels;

    @ApiModelProperty("漏电通道数")
    private Integer leakageChannels;

    @ApiModelProperty("温度通道数")
    private Integer tempChannels;

    @ApiModelProperty("漏电通道报警状态: 1-报警, 0-正常")
    private Integer leakageAlarmBit;

    @ApiModelProperty("温度通道1报警状态: 1-报警, 0-正常")
    private Integer temp1AlarmBit;

    @ApiModelProperty("温度通道2报警状态: 1-报警, 0-正常")
    private Integer temp2AlarmBit;

    @ApiModelProperty("温度通道3报警状态: 1-报警, 0-正常")
    private Integer temp3AlarmBit;

    @ApiModelProperty("温度通道4报警状态: 1-报警, 0-正常")
    private Integer temp4AlarmBit;

    @ApiModelProperty("DI1联动报警状态: 1-报警, 0-正常")
    private Integer di1AlarmBit;

    @ApiModelProperty("DI2联动报警状态: 1-报警, 0-正常")
    private Integer di2AlarmBit;

    @ApiModelProperty("漏电通道故障状态: 1-故障, 0-正常")
    private Integer leakageFaultBit;

    @ApiModelProperty("温度通道1故障状态: 1-故障, 0-正常")
    private Integer temp1FaultBit;

    @ApiModelProperty("温度通道2故障状态: 1-故障, 0-正常")
    private Integer temp2FaultBit;

    @ApiModelProperty("温度通道3故障状态: 1-故障, 0-正常")
    private Integer temp3FaultBit;

    @ApiModelProperty("温度通道4故障状态: 1-故障, 0-正常")
    private Integer temp4FaultBit;

    @ApiModelProperty("漏电通道使能状态: 1-通道开启, 0-通道关闭")
    private Integer leakageLinkBit;

    @ApiModelProperty("温度通道1使能状态: 1-通道开启, 0-通道关闭")
    private Integer temp1LinkBit;

    @ApiModelProperty("温度通道2使能状态: 1-通道开启, 0-通道关闭")
    private Integer temp2LinkBit;

    @ApiModelProperty("温度通道3使能状态: 1-通道开启, 0-通道关闭")
    private Integer temp3LinkBit;

    @ApiModelProperty("温度通道4使能状态: 1-通道开启, 0-通道关闭")
    private Integer temp4LinkBit;

    @ApiModelProperty("DI1使能状态: 1-闭合, 0-断开")
    private Integer di1LinkBit;

    @ApiModelProperty("DI2使能状态: 1-闭合, 0-断开")
    private Integer di2LinkBit;

    @ApiModelProperty("DO1使能状态: 1-闭合, 0-断开")
    private Integer do1LinkBit;

    @ApiModelProperty("DO2使能状态: 1-闭合, 0-断开")
    private Integer do2LinkBit;

    @ApiModelProperty("电力过压报警: 1-报警, 0-正常")
    private Integer overvoltage;

    @ApiModelProperty("电力欠压报警: 1-报警, 0-正常")
    private Integer undervoltage;

    @ApiModelProperty("电力缺相报警: 1-报警, 0-正常")
    private Integer phaseloss;

    @ApiModelProperty("电力过流报警: 1-报警, 0-正常")
    private Integer overcurrent;

    @ApiModelProperty("电力过载报警: 1-报警, 0-正常")
    private Integer overcapacity;

    @ApiModelProperty("漏电值(mA)")
    private Double leakageValue;

    @ApiModelProperty("温度通道1(℃)")
    private Double temp1;

    @ApiModelProperty("温度通道2(℃)")
    private Double temp2;

    @ApiModelProperty("温度通道3(℃)")
    private Double temp3;

    @ApiModelProperty("温度通道4(℃)")
    private Double temp4;

    @ApiModelProperty("电压变比")
    private Integer ptRatio;

    @ApiModelProperty("电流变比")
    private Integer ctRatio;

    @ApiModelProperty("A相电压(V)")
    private Double voltageA;

    @ApiModelProperty("B相电压(V)")
    private Double voltageB;

    @ApiModelProperty("C相电压(V)")
    private Double voltageC;

    @ApiModelProperty("A相电流(A)")
    private Double currentA;

    @ApiModelProperty("B相电流(A)")
    private Double currentB;

    @ApiModelProperty("C相电流(A)")
    private Double currentC;

    @ApiModelProperty("有功功率(kW)")
    private Double power;

    @ApiModelProperty("电能值(kWh)")
    private Long energy;

    @ApiModelProperty("数据域类型:0-数据域,1-设置域,2-控制域")
    private Integer ctrlDataDomain;

    @ApiModelProperty("应答标识:1-需应答,0-无需应答")
    private Integer ctrlNeedAck;

    @ApiModelProperty("通信状态:1-正常,0-异常")
    private Integer ctrlCommStatus;

    @ApiModelProperty("上报模式:0-主机轮询,1-从机应答,2-定时上报,3-变位上报")
    private Integer ctrlReportMode;

    @ApiModelProperty("寻址模式:0-四级地址,1-设备ID,2-逻辑地址,3-广播")
    private Integer ctrlAddrMode;

    @TableField(exist = false)
    private String equipmentId;
}
